package com.example.controller;

import com.example.entity.RescueDrill;
import com.example.ext.entity.ExtRescueDrill;
import com.example.service.RescueDrillService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created by simon on 2017/11/20.
 */
@RestController
@RequestMapping("api/rescueDrill")
public class RescueDrillController {

    @Autowired
    private RescueDrillService rescueDrillService;

    @ApiOperation(value = "查询救援演练列表",notes = "查询救援演练列表")
    @RequestMapping(value="/queryList",method = RequestMethod.POST)
    Map<String,Object> queryList(@RequestBody ExtRescueDrill extRescueDrill) {

        return rescueDrillService.queryByIdList(extRescueDrill);
    }

    @ApiOperation(value = "添加救援演练",notes = "添加救援演练")
    @RequestMapping(value="/add",method = RequestMethod.POST)
    Map<String,Object> add(@RequestBody RescueDrill rescueDrill) {
        return rescueDrillService.add(rescueDrill);
    }

}
